//
//  MovieNineCell.m
//  UI_豆瓣2.0
//
//  Created by dllo on 15/11/7.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "MovieNineCell.h"

@interface MovieNineCell ()

@property (nonatomic, retain) UIImageView *pictureImageView; // 图片
@property (nonatomic, retain) UILabel *nameLabel;           // 电影名

@end

@implementation MovieNineCell

- (void)dealloc
{
    [_pictureImageView release];
    [_nameLabel release];
    [_movieLNine release];
    [super dealloc];
}

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}

- (void)createSubViews{
    
    self.pictureImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, 85, 130)];
    self.pictureImageView.image = [UIImage imageNamed:@"picholder.png"];
    [self addSubview:self.pictureImageView];
    [_pictureImageView release];
    
    self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 145, 75, 10)];
    self.nameLabel.text = @"啦啦啦啦啦啦啦";
    self.nameLabel.font = [UIFont systemFontOfSize:12];
    self.nameLabel.textAlignment = NSTextAlignmentCenter;
    self.nameLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
    [self addSubview:self.nameLabel];
    [_nameLabel release];
    
}

#pragma mark -- 重写setter方法
-(void)setMovieLNine:(MovieList *)movieLNine{
    if (_movieLNine != movieLNine) {
        [_movieLNine release];
        _movieLNine = [movieLNine retain];
    }
    self.nameLabel.text = self.movieLNine.movieName;
    [self.pictureImageView  sd_setImageWithURL:[NSURL URLWithString:self.movieLNine.pic_url] placeholderImage:[UIImage imageNamed:@"picholder.png"]];
}


@end
